<script setup>
// 下拉菜单的选择
import { ref } from 'vue'
import { articleClassficationGetService } from '@/api/article'
const prop = defineProps({
  modelValue: [Number, String],
  width: {
    type: String
  }
})
const emit = defineEmits(['update:modelValue'])
const artList = ref()
const getArtList = async () => {
  const res = await articleClassficationGetService()
  artList.value = res.data
}
getArtList()

</script>

<template>
  <el-form-item label="文章分类" style="width:100%">
    <el-select :style="{ width:prop.width }" :modelValue="modelValue" @update:modelValue="emit('update:modelValue', $event)">
      <el-option
        :label="item.cate_name"
        :value="item.id"
        v-for="item in artList"
        :key="item.id"
      ></el-option>
    </el-select>
  </el-form-item>

</template>

